package router

import (
	"github.com/gin-gonic/gin"
	"week_three/client/models"
)

var Router *gin.Engine

func init() {
	Router = gin.New()
	Router.POST("car", func(ctx *gin.Context) {
		list, err := models.GetCarTypeAll(0)
		if err != nil {
			ctx.JSON(400, gin.H{
				"msg": err.Error(),
			})
			return
		}
		ctx.JSON(200, gin.H{
			"code": 200,
			"msg":  "success",
			"data": list,
		})
	})
}
